<template>
	<view>
		<image src="/static/work1.jpg" mode="" class="img_bg"></image> 
		<view class="" style="position: absolute; top: 0; width: 100%;">
			<view class="text-left card padding-l30 bg_white margin-t30">
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">设备名称</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.danger_name?danger_listMenu.danger_name:'-'}}</view>
				</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30 ">设备数量</view>
					<view class="text-32  padding-r30"  >{{danger_listMenu.num?danger_listMenu.num:'-'}}</view>
				</view>

				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30 ">设备型号</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.model?danger_listMenu.model:'-'}}</view>
				</view>
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">制造单位</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.production?danger_listMenu.production:'-'}}</view>
				</view>
				<view class="display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">出厂日期</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.out_time?danger_listMenu.out_time:'-'}}</view>
				</view>

				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">使用日期</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.user_time?danger_listMenu.user_time:'-'}}</view>
				</view>
				
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">定检日期</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.regular_time?danger_listMenu.regular_time:'-'}}</view>
				</view>
				
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">复检日期</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.reregular_time?danger_listMenu.reregular_time:'-'}}</view>
				</view>
				
				<view class="border-bottom display justify-between align-center">
					<view class="text-36 padding-t30 padding-b30">检验结果</view>
					<view class="text-32 font-gray1 padding-r30">{{danger_listMenu.regular_result?danger_listMenu.regular_result:'-'}}</view>
				</view>
			</view>
			<view class="button_start">
				<view @tap="start" class="starta starting">
					<view class="start-text">
						开始巡检
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				danger_id: '',
				danger_listMenu: {},
				danger_type: {},
				uid: '',
				token: '',
				msg: '',
				d_id: '',
				ldanger:'低风险',
				pdanger:'一般风险',
				mdanger:'较大风险',
				hdanger:'高风险'
			}
		},
		onLoad(options) {
			console.log(options)
			this.danger_id = options.id
			this.danger_list(options.id)
			this.uid = uni.getStorageSync('user').uid;
			this.token = uni.getStorageSync('user').token;
		},
		methods: {
			danger_list(e) {
				let _self = this;
				uni.request({
					url: 'https://aqmore.sxpz.vip/AppApi/Danger/detail?danger_id=' + e,
					method: 'GET',
					header: {
						'content-type': 'application/x-www-form-urlencoded'
					},
					success: function(res) {
						console.log(res)
						_self.danger_listMenu = res.data.datas.danger
						_self.danger_type = res.data.datas.danger.danger_type
						console.log(_self.danger_listMenu)
						console.log(_self.danger_type)
						_self.d_id = res.data.datas.danger.id
						console.log(_self.d_id)

					}
				})
			},
			start() {
				var that = this
				// uni.request({
				// 	url: 'https://aqmore.sxpz.vip/AppApi/Danger/isAllow?uid=' + this.uid + '&token=' + this.token + '&danger_id=' +
				// 		this.danger_id,
				// 	method: 'GET',
				// 	header: {
				// 		'content-type': 'application/x-www-form-urlencoded'
				// 	},
				// 	success: function(res) {
				// 		if (res.data.code == 200) {
				// 			console.log(res.data.datas.is_allow)
				// 			uni.navigateTo({
				// 				url: 'equipmentPollingDetail?id=' + that.danger_id,

				// 			})
				// 		} else if (res.data.code == 400) {
				// 			uni.showToast({
				// 				title: res.data.datas.msg,
				// 				icon: 'none'
				// 			})
				// 		}

				// 		// if(res.data.datas.is_allow)
				// 	}
				// })
				uni.navigateTo({
								url: 'equipmentPollingDetail?id=' + this.danger_id,
				
							})
			}
		},

	}
</script>

<style>
	page {
		height: 100%;
		width: 100%;
		/* background-color: #0d98ed; */
	}

	/*白色的card*/
	.card {
		background-color: #ffffff;
		box-shadow: 0 2upx 8upx 0 rgba(0, 0, 0, 0.06);
		border-radius: 20upx;
		padding: 30upx 24upx;
	}

	.margin-t30 {
		margin-top: 30upx;
	}

	.relative {
		position: relative;
	}

	.text-36 {
		font-size: 36upx;
	}

	.display {
		display: flex;
	}

	.justify-between {
		justify-content: space-between;
	}

	.margin-t22 {
		margin-top: 22upx;
	}

	.font-blue {
		color: #3F5EFF;
	}

	.font-gray1 {
		color: #00aaff;
	}

	.button_start {
		position: relative;
		left: 35%;

	}

	/* .starta{
		width:232upx;
		height:232upx;
		line-height: 232upx;
		background:linear-gradient(0deg,rgba(63,94,255,1),rgba(55,160,255,1));
		box-shadow:0 4upx 30upx 0 rgba(52,115,255,1);
		border-radius:50%;
		text-align: center;
		color: #fff;
		font-size:36upx;
		font-weight:bold;
		letter-spacing: 4upx;
		margin:0 auto;
		margin-top:650upx;
	} */
	.starting {
		top: 200upx;
		position: absolute;
		width: 232upx;
		height: 232upx;
		box-shadow: 0 4upx 30upx 0 rgba(52, 115, 255, 1);
		background-color: #309fff;
		border-radius: 100%;
		text-align: center;

	}

	.start-text {
		margin-top: 40%;
	}
	.font-0 {
		color: #3F5EFF;
	}
	
	.font-1 {
		color: #ffe200;
	}
	
	.font-2 {
		color: #ff5500;
	}
	
	.font-3 {
		color: #ff0000;
	}
</style>
